// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IWorkflowView.cs" company="Microsoft">
//   Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

namespace TrackingStateMachine
{
    using System;
    using System.Activities;
    using System.Runtime.DurableInstancing;

    /// <summary>
    /// The workflow view interface.
    /// </summary>
    public interface IWorkflowView
    {
        #region Public Properties

        /// <summary>
        /// Gets ConnectionString.
        /// </summary>
        string ConnectionString { get; }

        /// <summary>
        /// Gets InstanceStore.
        /// </summary>
        InstanceStore InstanceStore { get; }

        string DatabaseName { get; }

        #endregion

        #region Public Methods and Operators

        /// <summary>
        /// The on abort.
        /// </summary>
        /// <param name="args">
        /// The args.
        /// </param>
        void OnAbort(WorkflowApplicationAbortedEventArgs args);

        /// <summary>
        /// The on complete.
        /// </summary>
        /// <param name="args">
        /// The args.
        /// </param>
        void OnComplete(WorkflowApplicationCompletedEventArgs args);

        /// <summary>
        /// The on idle.
        /// </summary>
        /// <param name="args">
        /// The args.
        /// </param>
        void OnIdle(WorkflowApplicationIdleEventArgs args);

        /// <summary>
        /// The on unhandled exception.
        /// </summary>
        /// <param name="args">
        /// The args.
        /// </param>
        /// <returns>
        /// The unhandled exception action.
        /// </returns>
        UnhandledExceptionAction OnUnhandledException(WorkflowApplicationUnhandledExceptionEventArgs args);

        /// <summary>
        /// The on unload.
        /// </summary>
        /// <param name="obj">
        /// The obj.
        /// </param>
        void OnUnload(WorkflowApplicationEventArgs obj);

        /// <summary>
        /// The persistable idle.
        /// </summary>
        /// <param name="arg">
        /// The arg.
        /// </param>
        /// <returns>
        /// The persistable idle action
        /// </returns>
        PersistableIdleAction PersistableIdle(WorkflowApplicationIdleEventArgs arg);

        /// <summary>
        /// The write exception.
        /// </summary>
        /// <param name="exception">
        /// The exception.
        /// </param>
        /// <param name="error">
        /// The error.
        /// </param>
        void WriteException(Exception exception, string error);

        #endregion

        /// <summary>
        /// Notify the view that a property on the model has changed
        /// </summary>
        /// <param name="property">
        /// The property.
        /// </param>
        void NotifyChanged(string property);
    }
}